package com.iflysse.dao;

import com.iflysse.pojo.po.resp.CourseLabelPoResp;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;

@Repository
public interface CourseLabelDao {

    /**
     * 根据标签id 查询该标签绑定的课程
     * @param labelId
     * @return
     * @throws SQLException
     */
    @Select({"select * from tb_course_label where label_id=#{labelId} and is_delete=0"})
    @Results({
            @Result(property = "courseId",column = "course_id"),
            @Result(property = "labelId",column = "label_id"),
            @Result(property = "courseLabelId",column = "course_label_id"),
    })
    List<CourseLabelPoResp> queryCourseLabelByLabelId(String labelId)throws SQLException;

}
